package com.bjx.api.system.domain.vo;

import com.bjx.common.core.domain.group.Update;
import com.bjx.common.security.domain.UserPostVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @desc: 用户视图
 * @author: liushuai
 * @date: 2022/6/28
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Schema(title = "UserVO",description = "用户视图层")
public class UserVO {

    @NotBlank(message = "用户ID不能为空",groups = Update.class)
    @Schema(title = "userId",description = "用户Id")
    private String userId;

    @Schema(title = "realName",description = "真实名称")
    @Size(min = 1,max = 32,message = "真实名称长度为1到32个字符")
    @NotBlank(message = "真实名称不能为空")
    private String realName;

    @Schema(title = "username",description = "登录用户名")
    @NotBlank(message = "登录用户名不能为空")
    @Size(min = 1,max = 32,message = "登录用户名长度为1到32个字符")
    private String username;

    @Schema(title = "password",description = "密码")
    @Size(max = 64,message = "密码长度为1到64个字符")
    private  String password;

    @Schema(title = "phone",description = "手机号")
    @Size(max = 32,message = "手机号长度为1到32个字符")
    private String phone;

    @Schema(title = "numberId",description = "证件Id")
    @Size(max = 64,message = "手机号长度为1到64个字符")
    private String numberId;

    @Schema(title = "mail",description = "邮箱")
    @Size(max = 64,message = "邮箱长度为1到64个字符")
    private String mail;

    @Schema(title = "gender",description = "性别")
    @Range(min=1, max=3,message = "性别范围不对")
    private Byte gender;

    @Schema(title = "userCode",description = "用户编号")
    @Size(max = 64,message = "用户编号为1到64个字符")
    private String userCode;

    @Schema(title = "age",description = "年龄")
    @Range(min=1, max=999,message = "年龄范围为1到999")
    private Integer age;

    @Schema(title = "avatar",description = "头像")
    private Integer avatar;

    @Schema(title = "enabled",description = "是否启用")
    @Range(min=1, max=3,message = "是否启用范围不对")
    private Byte enabled;

    @Schema(title = "orgId",description = "组织机构Id")
    private String orgId;

    @Schema(title = "comId",description = "公司Id")
    private String comId;

    @Schema(title = "remark",description = "备注")
    @Size(max = 64,message = "手机号长度为1到64个字符")
    private String remark;

    @Size(max = 255,message = "用户首页")
    @Schema(title = "homePage",description = "用户首页")
    private String homePage;


    @Schema(title = "comName",description = "所属公司")
    private String comName;

    @Schema(title = "posts",description = "职位列表")
    private List<UserPostVO> posts;

    @Schema(title = "roleIds",description = "角色id列表")
    private List<String> roleIds;

    @Schema(title = "roles",description = "角色编号列表")
    private List<String> roles;

    @Schema(title = "auths",description = "权限标识列表")
    private List<String> auths;






}
